<extend name="Public/base"/>
<block name="sidebar">
    <include file="sidemenu" />
</block>
<block name="body">
	<div class="main-title">
		<h2>订单详情查看</h2>
	</div>

	<div class="cf">
	<if condition="$order.status eq 1">
	<a class="btn" href='__URL__/upstatus&id={$order.id}&status=2'>发货</a>
	</if>
		<!--<a class="btn" href="{:U('add')}">新 增</a>-->
		<!--<a class="btn" href="{:U('grantlist')}">授权商家</a> style="background:none;"-->
	</div>

	<div class="data-table table-striped">
		<table>
			<tbody>
				<tr style="background-color:#ffffff;"><td colspan="2"><b>订单信息</b></td></tr>
				<tr style="background:none;">
					<td width="80">订单编号</td>
					<td>{$order.sn}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">下单时间</td>
					<td>{$order.addtime|date="Y-m-d H:i:s",###}</td>
				</tr>
				<tr style="background:none;">
					<td width="100">订单金额</td>
					<td>{$order.money}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">优惠券金额</td>
					<td>{$order['coupon_money']}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">代金券金额</td>
					<td>{$order['cashcoup_money']}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">运费</td>
					<td>{$order.express_money}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">支付方式</td>
					<td><if condition="$order['paytype'] eq 2">支付宝支付<elseif condition="$order['paytype'] eq 0"/>微信支付</if></td>
				</tr>
				<tr style="background:none;">
					<td width="80">取货方式</td>
					<td><if condition="$order['type'] eq 1">门店自提<else/>送货上门</if></td>
				</tr>
				<tr style="background:none;">
					<td width="80">留言</td>
					<td>{$order.note}</td>
				</tr>
				<if condition="$order['type'] eq 0">
				<tr style="background-color:#ffffff;"><td colspan="2"><b>收货人信息</b></td></tr>
				<tr style="background:none;">
					<td width="80">姓名</td>
					<td>{$address.name}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">电话</td>
					<td>{$address.mobile}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">区域</td>
					<td>{$address.area}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">地址</td>
					<td>{$address.address}</td>
				</tr>
				<elseif condition="$order['type'] eq 1"/>
				<tr style="background-color:#ffffff;"><td colspan="2"><b>自提点信息</b></td></tr>
				<tr style="background:none;">
					<td width="80">自提点名称</td>
					<td>{$store.sname}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">联系电话</td>
					<td>{$store.mobile}</td>
				</tr>
				<tr style="background:none;">
					<td width="80">联系地址</td>
					<td>{$store.sadd}</td>
				</tr>
				</if>
			</tbody>
		</table>
	</div>
	
	<div class="data-table table-striped">
		<label><b>商品信息</b></label>
		<table>
			<thead>
				<tr>
					<th>商品名称</th>
					<th>商品规格</th>
                    <th>商品数量</th>
                    <th>价格</th>
				</tr>
			</thead>
			<tbody>
				<notempty name="list">
				<volist name="list" id="channel">
					<tr>
						<td>{$channel.title}</td>
						<td>
						<?php
						$attrlist=explode(',',$channel['product_attr']);
						$attr=array();
						foreach($attrlist as $item1)
						{
							list($name,$value)=explode('=',$item1);
							$attr[]=$name.'：'.$value;
						}
						if($attr){
							echo implode('；',$attr);
						}
						?>
						<!-- {:implode('；',$attr)} -->
						</td>
                        <td>{$channel.product_num}</td>
                        <td>{$channel.product_price}</td>
					</tr>
				</volist>
				<else/>
				<td colspan="4" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
			</tbody>
		</table>
		<div class="form-item cf">
			<a class="btn btn-return" href="__URL__/index">返 回</a>
		</div>
	</div>
</block>

<block name="script">
<script type="text/javascript">
    $(function() {
    	//导航高亮
    	highlight_subnav("{:U('Order/index')}");
    	//点击排序
    	$('.list_sort').click(function(){
    		var url = $(this).attr('url');
    		var ids = $('.ids:checked');
    		var param = '';
    		if(ids.length > 0){
    			var str = new Array();
    			ids.each(function(){
    				str.push($(this).val());
    			});
    			param = str.join(',');
    		}

    		if(url != undefined && url != ''){
    			window.location.href = url + '/ids/' + param;
    		}
    	});
    });
</script>
</block>